# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        
        # Adding model 'XSLT_docs'
        db.create_table('tardis_portal_xslt_docs', (
            ('xmlns', self.gf('django.db.models.fields.URLField')(max_length=400, primary_key=True)),
            ('data', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal('tardis_portal', ['XSLT_docs'])

        # Adding model 'Author'
        db.create_table('tardis_portal_author', (
            ('name', self.gf('django.db.models.fields.CharField')(max_length=400, primary_key=True)),
        ))
        db.send_create_signal('tardis_portal', ['Author'])

        # Adding model 'Experiment'
        db.create_table('tardis_portal_experiment', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=400)),
            ('approved', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('private_password', self.gf('django.db.models.fields.CharField')(max_length=50, null=True, blank=True)),
            ('ftp_location', self.gf('django.db.models.fields.CharField')(max_length=400, null=True, blank=True)),
            ('ftp_port', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
            ('ftp_username', self.gf('django.db.models.fields.CharField')(max_length=50, null=True, blank=True)),
            ('ftp_password', self.gf('django.db.models.fields.CharField')(max_length=50, null=True, blank=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=400)),
            ('institution_name', self.gf('django.db.models.fields.CharField')(max_length=400)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('update_time', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('created_by', self.gf('django.db.models.fields.CharField')(max_length=400)),
            ('handle', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('expid', self.gf('django.db.models.fields.CharField')(max_length=400)),
        ))
        db.send_create_signal('tardis_portal', ['Experiment'])

        # Adding model 'Author_Experiment'
        db.create_table('tardis_portal_author_experiment', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('experiment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Experiment'])),
            ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Author'])),
            ('order', self.gf('django.db.models.fields.PositiveIntegerField')()),
        ))
        db.send_create_signal('tardis_portal', ['Author_Experiment'])

        # Adding model 'Pdbid'
        db.create_table('tardis_portal_pdbid', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('experiment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Experiment'])),
            ('pdbid', self.gf('django.db.models.fields.CharField')(max_length=5)),
        ))
        db.send_create_signal('tardis_portal', ['Pdbid'])

        # Adding model 'Citation'
        db.create_table('tardis_portal_citation', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('experiment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Experiment'])),
            ('url', self.gf('django.db.models.fields.CharField')(max_length=400)),
        ))
        db.send_create_signal('tardis_portal', ['Citation'])

        # Adding model 'Dataset'
        db.create_table('tardis_portal_dataset', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('experiment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Experiment'])),
            ('description', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal('tardis_portal', ['Dataset'])

        # Adding model 'Dataset_File'
        db.create_table('tardis_portal_dataset_file', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('dataset', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Dataset'])),
            ('filename', self.gf('django.db.models.fields.CharField')(max_length=400)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=400)),
            ('size', self.gf('django.db.models.fields.CharField')(max_length=400, blank=True)),
        ))
        db.send_create_signal('tardis_portal', ['Dataset_File'])

        # Adding model 'Schema'
        db.create_table('tardis_portal_schema', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('namespace', self.gf('django.db.models.fields.URLField')(max_length=400)),
        ))
        db.send_create_signal('tardis_portal', ['Schema'])

        # Adding model 'ParameterName'
        db.create_table('tardis_portal_parametername', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('schema', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Schema'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('full_name', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('units', self.gf('django.db.models.fields.CharField')(max_length=60, blank=True)),
            ('is_numeric', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('tardis_portal', ['ParameterName'])

        # Adding model 'DatasetParameter'
        db.create_table('tardis_portal_datasetparameter', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('dataset', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Dataset'])),
            ('name', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.ParameterName'])),
            ('string_value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('numerical_value', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)),
        ))
        db.send_create_signal('tardis_portal', ['DatasetParameter'])

        # Adding model 'DatafileParameter'
        db.create_table('tardis_portal_datafileparameter', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('dataset_file', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.Dataset_File'])),
            ('name', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tardis_portal.ParameterName'])),
            ('string_value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('numerical_value', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)),
        ))
        db.send_create_signal('tardis_portal', ['DatafileParameter'])

        # Adding model 'XML_data'
        db.create_table('tardis_portal_xml_data', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('datafile', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['tardis_portal.Dataset_File'], unique=True, null=True, blank=True)),
            ('dataset', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['tardis_portal.Dataset'], unique=True, null=True, blank=True)),
            ('experiment', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['tardis_portal.Experiment'], unique=True, null=True, blank=True)),
            ('xmlns', self.gf('django.db.models.fields.URLField')(max_length=400)),
            ('data', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal('tardis_portal', ['XML_data'])


    def backwards(self, orm):
        
        # Deleting model 'XSLT_docs'
        db.delete_table('tardis_portal_xslt_docs')

        # Deleting model 'Author'
        db.delete_table('tardis_portal_author')

        # Deleting model 'Experiment'
        db.delete_table('tardis_portal_experiment')

        # Deleting model 'Author_Experiment'
        db.delete_table('tardis_portal_author_experiment')

        # Deleting model 'Pdbid'
        db.delete_table('tardis_portal_pdbid')

        # Deleting model 'Citation'
        db.delete_table('tardis_portal_citation')

        # Deleting model 'Dataset'
        db.delete_table('tardis_portal_dataset')

        # Deleting model 'Dataset_File'
        db.delete_table('tardis_portal_dataset_file')

        # Deleting model 'Schema'
        db.delete_table('tardis_portal_schema')

        # Deleting model 'ParameterName'
        db.delete_table('tardis_portal_parametername')

        # Deleting model 'DatasetParameter'
        db.delete_table('tardis_portal_datasetparameter')

        # Deleting model 'DatafileParameter'
        db.delete_table('tardis_portal_datafileparameter')

        # Deleting model 'XML_data'
        db.delete_table('tardis_portal_xml_data')


    models = {
        'tardis_portal.author': {
            'Meta': {'object_name': 'Author'},
            'name': ('django.db.models.fields.CharField', [], {'max_length': '400', 'primary_key': 'True'})
        },
        'tardis_portal.author_experiment': {
            'Meta': {'object_name': 'Author_Experiment'},
            'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Author']"}),
            'experiment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Experiment']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'order': ('django.db.models.fields.PositiveIntegerField', [], {})
        },
        'tardis_portal.citation': {
            'Meta': {'object_name': 'Citation'},
            'experiment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Experiment']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'url': ('django.db.models.fields.CharField', [], {'max_length': '400'})
        },
        'tardis_portal.datafileparameter': {
            'Meta': {'object_name': 'DatafileParameter'},
            'dataset_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Dataset_File']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.ParameterName']"}),
            'numerical_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'string_value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
        },
        'tardis_portal.dataset': {
            'Meta': {'object_name': 'Dataset'},
            'description': ('django.db.models.fields.TextField', [], {}),
            'experiment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Experiment']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'tardis_portal.dataset_file': {
            'Meta': {'object_name': 'Dataset_File'},
            'dataset': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Dataset']"}),
            'filename': ('django.db.models.fields.CharField', [], {'max_length': '400'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'size': ('django.db.models.fields.CharField', [], {'max_length': '400', 'blank': 'True'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '400'})
        },
        'tardis_portal.datasetparameter': {
            'Meta': {'object_name': 'DatasetParameter'},
            'dataset': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Dataset']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.ParameterName']"}),
            'numerical_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'string_value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
        },
        'tardis_portal.experiment': {
            'Meta': {'object_name': 'Experiment'},
            'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'created_by': ('django.db.models.fields.CharField', [], {'max_length': '400'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'expid': ('django.db.models.fields.CharField', [], {'max_length': '400'}),
            'ftp_location': ('django.db.models.fields.CharField', [], {'max_length': '400', 'null': 'True', 'blank': 'True'}),
            'ftp_password': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'ftp_port': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'ftp_username': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'handle': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'institution_name': ('django.db.models.fields.CharField', [], {'max_length': '400'}),
            'private_password': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '400'}),
            'update_time': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '400'})
        },
        'tardis_portal.parametername': {
            'Meta': {'object_name': 'ParameterName'},
            'full_name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_numeric': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Schema']"}),
            'units': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'})
        },
        'tardis_portal.pdbid': {
            'Meta': {'object_name': 'Pdbid'},
            'experiment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tardis_portal.Experiment']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'pdbid': ('django.db.models.fields.CharField', [], {'max_length': '5'})
        },
        'tardis_portal.schema': {
            'Meta': {'object_name': 'Schema'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'namespace': ('django.db.models.fields.URLField', [], {'max_length': '400'})
        },
        'tardis_portal.xml_data': {
            'Meta': {'object_name': 'XML_data'},
            'data': ('django.db.models.fields.TextField', [], {}),
            'datafile': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tardis_portal.Dataset_File']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
            'dataset': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tardis_portal.Dataset']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
            'experiment': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tardis_portal.Experiment']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'xmlns': ('django.db.models.fields.URLField', [], {'max_length': '400'})
        },
        'tardis_portal.xslt_docs': {
            'Meta': {'object_name': 'XSLT_docs'},
            'data': ('django.db.models.fields.TextField', [], {}),
            'xmlns': ('django.db.models.fields.URLField', [], {'max_length': '400', 'primary_key': 'True'})
        }
    }

    complete_apps = ['tardis_portal']
